tailwind css background image

93

tailwind css background image -

<!--
Arbitrary values
If you need to use a one-off background-image value that doesn’t make sense to include in your theme, use square brackets to generate a property on the fly using any arbitrary value.
-->

<div class="bg-[url('/img/hero-pattern.svg')]">
  <!-- Your Code -->
</div>

tailwind bg image -

  // tailwind.config.js
  module.exports = {
    theme: {
      extend: {
        backgroundImage: theme => ({
+         'hero-pattern': "url('/img/hero-pattern.svg')",
+         'footer-texture': "url('/img/footer-texture.png')",
        })
      }
    }
  }

Comments

Submit
0 Comments